// create by zhangguangde
// 评论页面

import React from 'react';
import ScoreModule from './score.module.scss';

class Score extends React.Component {

    // constructor(props) {
    //     super(props);
    // }
    // UNSAFE_componentWillMount() {
    // }
    componentDidMount() {
        // console.log(this.props.scoreObj)
    }
    // componentWillReceiveProps(newProps) {}
    // shouldComponentUpdate(newProps, newState) {
    // 	return true;
    // }
    // componentWillUpdate(nextProps, nextState) {}
    // componentDidUpdate(prevProps, prevState) {}
    // componentWillUnmount() {}

    render() {

        return (
            <div className={ScoreModule['Score']}>
                <div className={ScoreModule['left']}>
                    <div className={ScoreModule['content']}>
                        <p>
                            {this.props.scoreObj.synthesis}分
                        </p>
                        <label>
                            综合得分
                        </label>
                        <span>
                            ￥{this.props.scoreObj.consumption}/人
                        </span>
                    </div>
                </div>
                <div className={ScoreModule['right']}>
                    <div className={ScoreModule['content']}>
                        <div className={ScoreModule['item']}>
                            体验
                            <div className={ScoreModule['comment-star-bg']}>
                                <div className={ScoreModule['comment-star']} style={{width: (this.props.scoreObj.experience * 20) + '%'}}></div>
                            </div>
                            {this.props.scoreObj.experience}分
                        </div>
                        <div className={ScoreModule['item']}>
                            环境
                            <div className={ScoreModule['comment-star-bg']}>
                                <div className={ScoreModule['comment-star']} style={{width: (this.props.scoreObj.environment * 20) + '%'}}></div>
                            </div>
                            {this.props.scoreObj.environment}分
                        </div>
                        <div className={ScoreModule['item']}>
                            服务
                            <div className={ScoreModule['comment-star-bg']}>
                                <div className={ScoreModule['comment-star']} style={{width: (this.props.scoreObj.service * 20) + '%'}}></div>
                            </div>
                            {this.props.scoreObj.service}分
                        </div>
                    </div>
                </div>
                
            </div>
        );
    }
}

export default Score;

